package com.aaa.emp.controller;

import com.aaa.common.entity.Book;
import com.aaa.common.entity.Emp;
import com.aaa.emp.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ：杨
 * @date ：Created in 2020/7/22 14:40
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("emp")
public class EmpController {
    @Autowired
    EmpService empService;

    @RequestMapping("list")
    public Map selectEmp(){
        List<Emp> emps = empService.selectEmp();
        List<Book> books = empService.selectBook();
        Map map=new HashMap();
        map.put("emps",emps);
        map.put("books",books);
        return map;
    }
}
